<?php
  //$fp=fopen("log/log.txt","r");
   
    require ( 'init.inc.php' );
    require ( 'checkadmin.inc.php');
	require ( __COMM_PATH . 'pagecontrol.inc.php' );
	require ( __CLASS_PATH . 'page_list.class.php' );
     // -------------------------------------------------------
    // 接收参数
    // -------------------------------------------------------
	$action=$_REQUEST['action'];
	//echo $action;
    // -------------------------------------------------------
    // 读取文件内容
    // -------------------------------------------------------
    $str=file_get_contents("log/log.txt");
	if($action=="deletelog"){
			$fp=fopen("log/log.txt",w);
			fwrite($fp,'');
			fclose($fp);
			header("location: manager_log.php");
		}
 
    // -------------------------------------------------------
    // 页面基本设置
    // -------------------------------------------------------
    $page_title   = $ptitle["news_list"];
    $display_page = "manager_log.htm";


    // -------------------------------------------------------
    // 执行页面处理
    // -------------------------------------------------------
	$tpl->assign("logstr",$str);
    show_page_head("list",$page_title);
	if($_SESSION['AdminLevel']=="0"){
    	$plist = new PageList($page_title, $page_size);
   		$plist->TplParse($display_page);
	}else{
		echo "你无权查看！";
		}
    show_page_foot();
    $db->close();
?>